/*
 * SumLattice.h
 *
 *  Created on: Sep 9, 2012
 *      Author: Wanderer
 */

#ifndef SUMLATTICE_H_
#define SUMLATTICE_H_

#include "CRF.h"

class SumLattice {
private:
	int length;
	par_t** pars;
	par_t* inipars;
	par_t* finpars;
	quiver_t* input;
	value_t* constrain;
	double** alpha;
	double** beta;
	double** gammas;
	double*** weights;
	double totalWeight;
	bool checkPath(int ip, int state);
public:
	SumLattice(CRF* model, quiver_t* input);
	SumLattice(CRF* model, quiver_t* input, value_t* constrain);
	double getWeight(int ip, int i, int j);
	double getInitialWeight(int i);
	double getFinalWeight(int i);
	virtual ~SumLattice();
};

#endif /* SUMLATTICE_H_ */
